home *** CD-ROM | disk | FTP | other *** search
-
- (*
-
- LOGSCAN 01.01.1988 *> Logbuchauswertung <* DF3AV R.R]DIGER PEINE
-
- *)
-
- Uses Printer,Dos,Crt;
-
-
- Type
-
- UserRec = Record
- Call : String[6];
- Count : Integer;
- Dauer : Integer;
- Durch : Integer;
- Bytes : real;
- End;
-
- Str5 = String[5];
- AnyStr = String[255];
- Str8 = String[8];
-
- Var
-
- User : Array[1..1000] of UserRec;
- Uebersicht : Array[1..31,0..23] of Integer;
- Betrieb : Array[0..23] of integer;
- Bytes : Array[0..23] of Real;
- Baud_std : Array[0..23] of Real;
- UserCount : Integer;
- LogCount : Integer;
- LogFile : Text;
- ImportChan : Text;
- Drucker : Boolean;
- Call : String[6];
- Ch : Char;
- FirstDate : String[40];
- LastDate : String[40];
- AllTime : Real;
- Stunde : Integer;
- Tag : Integer;
- FirstTag : Integer;
- maxTag : Integer;
- maxBetrieb : Integer;
- i : Integer;
- N : Integer;
- MaxTime : Real;
- MaxByte : real;
- UserTime : Real;
- ByteCount : Real;
- GlobalByteCount : Real;
- GlobalBytesDurch : Real;
- Baud : Real;
- MaxBaud : Real;
- MinBaud : Real;
- FirstTime : String[40];
- LastTime : String[40];
- LaufZeit : Real;
-
- Channel1 : Integer;
- Channel2 : Integer;
- Channel3 : Integer;
- Channel4 : Integer;
- Channel5 : Integer;
- Channel6 : Integer;
- Channel7 : Integer;
- Channel8 : Integer;
- Channel9 : Integer;
-
- BoxProto : Boolean;
-
- Procedure Sort;
- Type Dummy = Record
- Call : String[6];
- Count : Integer;
- Dauer : Integer;
- Durch : Integer;
- Bytes : real;
- End;
-
- var b : String[6];
- x,y,z : Integer;
- ok : boolean;
- Dumm : Dummy;
-
- Begin
- for x := 2 to UserCount do begin
- Dumm.Call := User[x].Call;
- Dumm.Count := User[x].Count;
- Dumm.Dauer := User[x].Dauer;
- Dumm.Durch := User[x].Durch;
- Dumm.Bytes := User[x].Bytes;
- y:=0;ok := false;
- repeat
- y := succ(y);
- if User[y].Call >= Dumm.Call then begin;
- for z := x-1 downto y do begin;
- User[z+1].Call := User[z].Call;
- User[z+1].Count:= User[z].Count;
- User[z+1].Dauer:= User[z].Dauer;
- User[z+1].Durch:= User[z].Durch;
- User[z+1].Bytes:= User[z].Bytes;
- ok := true;
- end;
- if OK = true then
- begin;
- User[y].Call := Dumm.Call;
- User[y].Count:= Dumm.Count;
- User[y].Dauer:= Dumm.Dauer;
- User[y].Durch:= Dumm.Durch;
- User[y].Bytes:= Dumm.Bytes;
- end;
- end;
- until (y = x) or (ok = true);
- write(#13,x:7);
- end;
- End;
-
-
- function Wochentag (Jahr : Str8) : integer;
- var x,y,z,a,b :integer;
- Schaltjahr:boolean;
- Arbeit : String[2];
- begin
- b := 0;Schaltjahr := false;
- Arbeit := copy (Jahr,1,2);
- val(Arbeit,x,a);
- Arbeit := copy (Jahr,4,2);
- val(Arbeit,y,a);
- case y of
- 2 : b := 1;
- 3 : b := 0;
- 4 : b := 1;
- 5 : b := 1;
- 6 : b := 2;
- 7 : b := 2;
- 8 : b := 3;
- 9 : b := 4;
- 10 : b := 4;
- 11 : b := 5;
- 12 : b := 5;
- end;
- Arbeit := copy (Jahr,7,2);
- val(Arbeit,z,a);
- if (z mod 4 = 0) then Schaltjahr := true;
- If not Schaltjahr and (y >2) then b := b-1;
- Wochentag := x+b+30*(y-1);
- end;
-
- function Minuten (Jahr : Str5) : integer;
- var x,y,a :integer;
- Arbeit : String[2];
- begin
- Arbeit := copy (Jahr,1,2);
- val(Arbeit,x,a);
- Arbeit := copy (Jahr,4,2);
- val(Arbeit,y,a);
- Minuten := y+60*(x);
- end;
-
-
-
- (* berechnet die Differenz in Minuten zwischen 2 Time-Strings *)
-
- function TimeDiff(LogZeile:AnyStr) : integer;
- var result : integer;
- vonStunden,
- vonMinuten,
- bisStunden,
- bisMinuten : integer;
- Fehler : integer;
- i : integer;
- ByteString : string[6];
- Begin
- result := 0;
- vonStunden := 0;
- vonMinuten := 0;
- bisStunden := 0;
- bisMinuten := 0;
- Fehler := 0;
- i := 0;
- ByteString := ' ';
-
- ByteCount := 0;
- val(copy(LogZeile,19,2),vonStunden,Fehler);
- if Fehler = 0 then
- val(copy(LogZeile,22,2),vonMinuten,Fehler);
- if Fehler = 0 then
- val(copy(LogZeile,27,2),bisStunden,Fehler);
- if Fehler = 0 then
- val(copy(LogZeile,30,2),bisMinuten,Fehler);
- if Fehler = 0 then
- begin
- if bisStunden < vonStunden then bisStunden := bisStunden + 24;
- result := 60 * (bisStunden - vonStunden) + bisMinuten - vonMinuten;
- Stunde := vonStunden;
- val(copy(LogZeile,9,2),Tag,Fehler);
- if Tag > maxTag then maxTag := Tag;
- ByteString := copy(LogZeile,39,6);
- while (copy(ByteString,1,1) = ' ') do DELETE(ByteString,1,1);
- val(ByteString,ByteCount,Fehler);
- If Fehler <> 0 then ByteCount := 0;
- GlobalByteCount := GlobalByteCount + ByteCount;
- end
- else result := -1;
- TimeDiff := result;
- MaxTime := MaxTime + result;
- End;
-
-
-
- procedure OutUebersicht(Drucker:boolean);
- Var
- i : Integer;
- Maxbytes : real;
- maxBaud_std : real;
- Bytes_std : Array [0..23] of real;
- Betrieb_d : Array [0..23] of integer;
- begin
- i := 0;
- for Stunde := 0 to 23 do
- Begin
- for Tag := FirstTag to maxTag do
- Begin
- Betrieb[Stunde] := Betrieb[Stunde] + Uebersicht[Tag,Stunde];
- End;
- End;
-
- for Stunde := 0 to 23 do
- if maxBetrieb < Betrieb[Stunde] then maxBetrieb := Betrieb[Stunde];
- for Stunde := 0 to 23 do
- Betrieb_d[Stunde] := round(Betrieb[Stunde] * 20.0 / maxBetrieb);
-
- (* Balkendiagramm *)
- writeln;writeln;
- writeln(' T a g e s b e l a s t u n g C o n n e c t s');
- writeln(' ---------------------------------------------');
- writeln;
-
- if Drucker then
- begin
- writeln(lst);writeln(lst);
- writeln(lst,' T a g e s b e l a s t u n g C o n n e c t s');
- writeln(lst,' --------------------------------------------');
- writeln(lst);
- end;
-
- if BoxProto then
- begin
- writeln(ImportChan,'S STATISTI @ ',ParamStr(1),#13#10'Diagramm Connects');
- writeln(ImportChan);writeln(ImportChan);
- writeln(ImportChan,' T a g e s b e l a s t u n g C o n n e c t s');
- writeln(ImportChan,' --------------------------------------------');
- writeln(ImportChan);
- end;
-
- for i := 20 downto 0 do
- Begin
- if (i mod 5 = 0) then
- Begin
- (* Skalierung *)
- write((maxBetrieb * i / 20.0 / maxTag):4:1);
- if Drucker then
- write(lst,#13#10,(maxBetrieb * i / 20.0 / maxTag):4:1);
-
- if BoxProto then
- write(ImportChan,#13#10,(maxBetrieb * i / 20.0 / maxTag):4:1);
-
- End
- else
- begin
- write(' ');
- if Drucker then
- write(lst,#13#10' ');
- if BoxProto then
- write(ImportChan,#13#10' ');
- end;
- for Stunde := 0 to 23 do
- Begin
- if (i mod 5 = 0) and (i <> 0) then
- Begin
- if Betrieb_d[Stunde] >= i then write(' .▒') else write(' . ');
- if Drucker then
- begin
- if Betrieb_d[Stunde] >= i then write(lst,' .▒') else write(lst,' . ');
- end;
- if BoxProto then
- begin
- if Betrieb_d[Stunde] >= i then write(ImportChan,' .▒') else write(ImportChan,' . ');
- end;
- End
- else
- Begin
- if Betrieb_d[Stunde] >= i then write(' ▒') else write(' ');
- if Drucker then
- begin
- if Betrieb_d[Stunde] >= i then write(lst,' ▒') else write(lst,' ');
- end;
- if BoxProto then
- begin
- if Betrieb_d[Stunde] >= i then write(ImportChan,' ▒') else write(ImportChan,' ');
- end;
- End;
- End;
- writeln;
- end;
- writeln(' ----------------------------------------------------------------------------');
- write(' Std');
- for Stunde := 0 to 23 do write(Stunde:3);
- writeln;
- if Drucker then
- begin
- writeln(lst,#13#10' ----------------------------------------------------------------------------');
- write(lst,' Std');
- for Stunde := 0 to 23 do write(lst,Stunde:3);
- writeln(lst);
- end;
- if BoxProto then
- begin
- writeln(ImportChan,#13#10' ----------------------------------------------------------------------------');
- write(ImportChan,' Std');
- for Stunde := 0 to 23 do write(ImportChan,Stunde:3);
- writeln(ImportChan);
- end;
- i := 0;
- if Not Drucker then Begin;
- Write(' Weiter mit Taste !');
- ch := readkey;
- End;
- if(BoxProto) then writeln(ImportChan,'***end');
- MaxBytes := 0;
- LaufZeit := 0;
- LaufZeit := ((Wochentag(Lastdate) * 24.0 * 60.0)+Minuten(LastTime));
- Laufzeit := Laufzeit - ((Wochentag(Firstdate) * 24.0 * 60.0)+Minuten(FirstTime));
-
- for Stunde := 0 to 23 do
- if maxBytes < Bytes[Stunde] then maxBytes := Bytes[Stunde];
- MaxBytes := round(MaxBytes / 1024.0 * 60.0 * 24.0 / Laufzeit);
-
- for Stunde := 0 to 23 do
- Bytes_std[Stunde] := round(Bytes[Stunde] * 20.0 / 1024.0 / MaxBytes * 60.0 * 24.0 / Laufzeit);
-
- (* Balkendiagramm *)
- writeln;writeln;
- writeln(' T a g e s b e l a s t u n g K - B y t e s');
- writeln(' -------------------------------------------');
- writeln;
-
- if Drucker then
- begin
- writeln(lst);writeln(lst);
- writeln(lst,' T a g e s b e l a s t u n g K - B y t e s');
- writeln(lst,' --------------------------------------------');
- writeln(lst);
- end;
-
- if BoxProto then
- begin
- writeln(ImportChan,'S Statisti @ ',ParamStr(1),#13#10'Diagramm KBytes');
- writeln(ImportChan);writeln(ImportChan);
- writeln(ImportChan,' T a g e s b e l a s t u n g K - B y t e s');
- writeln(ImportChan,' --------------------------------------------');
- writeln(ImportChan);
- end;
- for i := 20 downto 0 do
- Begin
- if (i mod 5 = 0) then
- Begin
- (* Skalierung *)
- write((maxBytes * i / 20.0 ):5:0);
- if Drucker then
- write(lst,#13#10,(maxBytes * i / 20.0 ):5:0);
- if BoxProto then
- write(ImportChan,#13#10,(maxBytes * i / 20.0 ):5:0);
- End
- else
- begin
- write(' ');
- if Drucker then
- write(lst,#13#10' ');
- if BoxProto then
- write(ImportChan,#13#10' ');
- end;
- for Stunde := 0 to 23 do
- Begin
- if (i mod 5 = 0) and (i <> 0) then
- Begin
- if Bytes_std[Stunde] >= i then write(' .▒') else write(' . ');
- if Drucker then
- begin
- if Bytes_std[Stunde] >= i then write(lst,' .▒') else write(lst,' . ');
- end;
- if BoxProto then
- begin
- if Bytes_std[Stunde] >= i then write(ImportChan,' .▒') else write(ImportChan,' . ');
- end;
- End
- else
- Begin
- if Bytes_std[Stunde] >= i then write(' ▒') else write(' ');
- if Drucker then
- begin
- if Bytes_std[Stunde] >= i then write(lst,' ▒') else write(lst,' ');
- end;
- if BoxProto then
- begin
- if Bytes_std[Stunde] >= i then write(ImportChan,' ▒') else write(ImportChan,' ');
- end;
- End;
- End;
- writeln;
- End;
- writeln(' ----------------------------------------------------------------------------');
- write(' Std');
- for Stunde := 0 to 23 do write(Stunde:3);
- writeln;
- if Drucker then
- begin
- writeln(lst,#13#10' ----------------------------------------------------------------------------');
- write(lst,' Std');
- for Stunde := 0 to 23 do write(lst,Stunde:3);
- write(lst,^L);
- end;
- if BoxProto then
- begin
- writeln(ImportChan,#13#10' ----------------------------------------------------------------------------');
- write(ImportChan,' Std');
- for Stunde := 0 to 23 do write(ImportChan,Stunde:3);
- writeln(ImportChan,#13#10'***end');
- end;
- if Not Drucker then Begin;
- Write(' Weiter mit Taste !');
- ch := readkey;
- End;
- i := 0;
- maxBaud_std := 0;
- for Stunde := 0 to 23 do
- Baud_std[Stunde] := Baud_std[Stunde] / Betrieb[Stunde];
- for Stunde := 0 to 23 do
- if maxBaud_std < Baud_std[Stunde] then maxBaud_std := Baud_std[Stunde];
- for Stunde := 0 to 23 do
- Baud_std[Stunde] := round(Baud_std[Stunde] * 20.0 / maxBaud_std);
-
- (* Balkendiagramm *)
- writeln;writeln;
- writeln(' T a g e s b e l a s t u n g B A U D - E F F.');
- writeln(' ----------------------------------------------');
- writeln;
-
- if Drucker then
- begin
- writeln(lst);writeln(lst);
- writeln(lst,' T a g e s b e l a s t u n g B A U D - E F F.');
- writeln(lst,' -----------------------------------------------');
- writeln(lst);
- end;
-
- if BoxProto then
- begin
- writeln(ImportChan,'S Statisti @ ',ParamStr(1),#13#10'Diagramm Baudraten');
- writeln(ImportChan);writeln(ImportChan);
- writeln(ImportChan,' T a g e s b e l a s t u n g B A U D - E F F.');
- writeln(ImportChan,' -----------------------------------------------');
- writeln(ImportChan);
- end;
- for i := 20 downto 0 do
- Begin
- if (i mod 5 = 0) then
- Begin
- (* Skalierung *)
- write((maxbaud_std * i / 20.0 ):5:0);
- if Drucker then
- write(lst,#13#10,(maxbaud_std * i / 20.0 ):5:0);
- if BoxProto then
- write(ImportChan,#13#10,(maxbaud_std * i / 20.0 ):5:0);
- End
- else
- begin
- write(' ');
- if Drucker then
- write(lst,#13#10' ');
- if BoxProto then
- write(ImportChan,#13#10' ');
- end;
- for Stunde := 0 to 23 do
- Begin
- if (i mod 5 = 0) and (i <> 0) then
- Begin
- if Baud_std[Stunde] >= i then write(' .▒') else write(' . ');
- if Drucker then
- begin
- if Baud_std[Stunde] >= i then write(lst,' .▒') else write(lst,' . ');
- end;
- if BoxProto then
- begin
- if Baud_std[Stunde] >= i then write(ImportChan,' .▒') else write(ImportChan,' . ');
- end;
- End
- else
- Begin
- if Baud_std[Stunde] >= i then write(' ▒') else write(' ');
- if Drucker then
- begin
- if Baud_std[Stunde] >= i then write(lst,' ▒') else write(lst,' ');
- end;
- if BoxProto then
- begin
- if Baud_std[Stunde] >= i then write(ImportChan,' ▒') else write(ImportChan,' ');
- end;
- End;
- End;
- writeln;
- End;
- writeln(' ----------------------------------------------------------------------------');
- write(' Std');
- for Stunde := 0 to 23 do write(Stunde:3);
- writeln;
- if Drucker then
- begin
- writeln(lst,#13#10' ----------------------------------------------------------------------------');
- write(lst,' Std');
- for Stunde := 0 to 23 do write(lst,Stunde:3);
- writeln(lst,^O^L);
- end;
- if BoxProto then
- begin
- writeln(ImportChan,#13#10' ----------------------------------------------------------------------------');
- write(ImportChan,' Std');
- for Stunde := 0 to 23 do write(ImportChan,Stunde:3);
- writeln(ImportChan);
- end;
- if Not Drucker then Begin;
- Write(' Weiter mit Taste !');
- ch := readkey;
- End;
- end;
-
- procedure OutChannel(Drucker:boolean);
- Var Gesamt : Integer;
- Ergo : Real;
- begin
- Gesamt := 0;
- Ergo := 0;
-
- Gesamt := Channel1
- + Channel2
- + Channel3
- + Channel4
- + Channel5
- + Channel6
- + Channel7
- + Channel8
- + Channel9;
- writeln;
-
- UserTime:= MaxTime / UserCount;
- MaxTime := MaxTime / LogCount;
- writeln('Anzahl der Connects..........................: ',
- LogCount:8);
- writeln('Anzahl der Stationen.........................: ',
- UserCount:8);
- writeln('Durchschnittliche Verbindungszeit pro Connect: ',
- MaxTime:8:0);
- writeln('Durchschnittliche Verbindungszeit pro User...: ',
- UserTime:8:0);
- writeln('Anzahl der ausgelesenen Zeichen .............: ',
- GlobalByteCount:8:0);
- writeln('Durchschnittlich ausgel. Zeichen pro User ...: ',
- (GlobalBytesDurch/UserCount):8:0);
- writeln('Max./ Durch./ Min. Baudzahl eines Users .....: ',
- (MaxBaud):8:0,(GlobalByteCount/AllTime/8):8:0,(MinBaud):8:0);
- writeln('Auslastung des Systems in % .................: ',
- (AllTime/LaufZeit*100):8:0);
-
- if(Drucker) then
- begin
- writeln(lst,#13#10#18); (* Drucker wieder auf Pica *)
- writeln(Lst,'Anzahl der Connects..........................: ',
- LogCount:8);
- writeln(Lst,'Anzahl der Stationen.........................: ',
- UserCount:8);
- writeln(lst,'Durchschnittliche Verbindungszeit pro Connect: ',
- MaxTime:8:0);
- writeln(lst,'Durchschnittliche Verbindungszeit pro User...: ',
- UserTime:8:0);
- writeln(lst,'Anzahl der ausgelesenen Zeichen .............: ',
- GlobalByteCount:8:0);
- writeln(lst,'Durchschnittlich ausgel. Zeichen pro User ...: ',
- (GlobalBytesDurch/UserCount):8:0);
- writeln(lst,'Max./ Durch./ Min. Baudzahl eines Users .....: ',
- (MaxBaud):8:0,(GlobalByteCount/AllTime/8):8:0,(MinBaud):8:0);
- writeln(lst,'Auslastung des Systems in % .................: ',
- (AllTime/LaufZeit*100):8:0);
- writeln(lst);
- writeln(Lst,'Auslastung pro Kanal in Prozent:'#13#10);
- writeln(Lst,'Kanal 1 2 3 4 5 6 7 8 9');
- write(Lst,' ');
- end;
- if(BoxProto) then
- begin
- writeln(ImportChan,'S Statisti @ ',ParamStr(1),#13#10'Absolut-Werte');
- writeln(ImportChan,#13#10'Anzahl der Connects..........................: ',
- LogCount:8);
- writeln(ImportChan,'Anzahl der Stationen.........................: ',
- UserCount:8);
- writeln(ImportChan,'Durchschnittliche Verbindungszeit pro Connect: ',
- MaxTime:8:0);
- writeln(ImportChan,'Durchschnittliche Verbindungszeit pro User...: ',
- UserTime:8:0);
- writeln(ImportChan,'Anzahl der ausgelesenen Zeichen .............: ',
- GlobalByteCount:8:0);
- writeln(ImportChan,'Durchschnittlich ausgel. Zeichen pro User ...: ',
- (GlobalBytesDurch/UserCount):8:0);
- writeln(ImportChan,'Max./ Durch./ Min. Baudzahl eines Users .....: ',
- (MaxBaud):8:0,(GlobalByteCount/AllTime/8):8:0,(MinBaud):8:0);
- writeln(ImportChan,'Auslastung des Systems in % .................: ',
- (AllTime/LaufZeit*100):8:0);
- writeln(ImportChan);
- writeln(ImportChan,'Auslastung pro Kanal in Prozent:'#13#10);
- writeln(ImportChan,'Kanal'#13#10' 1 2 3 4 5 6 7 8 9');
- end;
- writeln(#13#10'Auslastung pro Kanal in Prozent:'#13#10);
- writeln('Kanal'#13#10' 1 2 3 4 5 6 7 8 9');
- Ergo := (Channel1/Gesamt) * 100;
- if(Drucker) then write(Lst,Ergo:8:1);
- if(BoxProto) then write(ImportChan,Ergo:8:1);
- write(Ergo:8:1);
- Ergo := (Channel2/Gesamt) * 100;
- if(Drucker) then write(Lst,Ergo:8:1);
- if(BoxProto) then write(ImportChan,Ergo:8:1);
- write(Ergo:8:1);
- Ergo := (Channel3/Gesamt) * 100;
- if(Drucker) then write(Lst,Ergo:8:1);
- if(BoxProto) then write(ImportChan,Ergo:8:1);
- write(Ergo:8:1);
- Ergo := (Channel4/Gesamt) * 100;
- if(Drucker) then write(Lst,Ergo:8:1);
- if(BoxProto) then write(ImportChan,Ergo:8:1);
- write(Ergo:8:1);
- Ergo := (Channel5/Gesamt) * 100;
- write(Ergo:8:1);
- if(Drucker) then write(Lst,Ergo:8:1);
- if(BoxProto) then write(ImportChan,Ergo:8:1);
- Ergo := (Channel6/Gesamt) * 100;
- write(Ergo:8:1);
- if(Drucker) then write(Lst,Ergo:8:1);
- if(BoxProto) then write(ImportChan,Ergo:8:1);
- Ergo := (Channel7/Gesamt) * 100;
- write(Ergo:8:1);
- if(Drucker) then write(Lst,Ergo:8:1);
- if(BoxProto) then write(ImportChan,Ergo:8:1);
- Ergo := (Channel8/Gesamt) * 100;
- if(Drucker) then write(Lst,Ergo:8:1);
- if(BoxProto) then write(ImportChan,Ergo:8:1);
- write(Ergo:8:1);
- Ergo := (Channel9/Gesamt) * 100;
- if(Drucker) then write(Lst,Ergo:8:1);
- if(BoxProto) then write(ImportChan,Ergo:8:1);
- write(Ergo:8:1);
- if(BoxProto) then writeln(ImportChan,#13#10'***end');
- writeln;
- end;
-
-
- procedure OutUser(Drucker:boolean);
-
- Var I : Integer;
- SingleUser : UserRec;
- Count : Integer;
- Ch1,Ch2 : Char;
- BytesDurch : Real;
- begin
- Count := 0;
- Ch1 := ' ';
- Ch2 := ' ';
- BytesDurch := 0;
- i := 0;
-
- writeln(^M^J^M^J^M^J'Einzelauswertung');
- writeln( '----------------'^M^J);
- writeln('Call LgIn ZGes ZCon Bytes BCon Baud');
- write( '--------------------------------------------');
-
- if Drucker then
- Begin
- writeln(lst,^M^J^M^J^M^J'Einzelauswertung');
- writeln(lst, '----------------'^M^J);
- writeln(lst,^O'Call LgIn ZGes ZCon Bytes BCon Baud Call LgIn ZGes ZCon Bytes BCon Baud');
- (* Schmalschrift mit ^O einschalten; FormFeed mit ^L;*)
- write(lst, '--------------------------------------------------------------------------------------------');
- End;
- For I := 1 to UserCount do
- begin
- SingleUser := User[i];
- If SingleUser.Count > 0 then
- begin
- Count := Count + 1;
-
- if (Ch2 <> SingleUser.Call[2]) or (Ch1 <> SingleUser.Call[1]) then
- begin
- Count := 3;
- writeln;
- if Drucker then writeln(lst);
- if(BoxProto) then
- begin
- writeln(ImportChan,#13#10'***end');
- writeln(ImportChan,'s statisti @ ',ParamStr(1),#13#10'Einzelauswertung ',copy(SingleUser.Call,1,3),' ->');
- writeln(ImportChan);
- writeln(ImportChan,'Call LgIn ZGes ZCon Bytes BCon Baud');
- writeln(ImportChan,'--------------------------------------------');
- end;
- end;
-
- if Count = 3 then
- begin
- Count := 1;
- if Drucker then writeln(lst);
- end;
-
- SingleUser.Durch := SingleUser.Dauer div SingleUser.Count;
- BytesDurch := SingleUser.Bytes/SingleUser.Count;
- GlobalBytesDurch:= GlobalBytesDurch + BytesDurch;
- If SingleUser.Dauer = 0 then SingleUser.Dauer := 1;
- Baud:=SingleUser.Bytes/SingleUser.Dauer*8/60;
- Baud := Baud +0.5;
- If Baud > MaxBaud then MaxBaud := Baud;
- If Baud < MinBaud then MinBaud := Baud;
- writeln(SingleUser.Call,SingleUser.Count:4,
- SingleUser.Dauer:5,SingleUser.Durch:5,
- SingleUser.Bytes:9:0,BytesDurch:7:0,Baud:8:0);
- if(BoxProto) then
- begin
- writeln(ImportChan,SingleUser.Call,SingleUser.Count:4,
- SingleUser.Dauer:5,SingleUser.Durch:5,
- SingleUser.Bytes:9:0,BytesDurch:7:0,Baud:8:0);
- end;
- if Drucker then
- Begin
- write(lst,SingleUser.Call,SingleUser.Count:4,SingleUser.Dauer:5,SingleUser.Durch:5,
- SingleUser.Bytes:9:0,BytesDurch:7:0,Baud:8:0);
- if Count = 1 then write(lst,' ');
- End;
- Ch2 := SingleUser.Call[2];
- Ch1 := SingleUser.Call[1];
- end;
- end;
- writeln;
- if Drucker then writeln(lst);
- if(BoxProto) then writeln(ImportChan,'***end');
- end;
-
-
- function NewUser(Str:AnyStr) : boolean;
- Var SingleUser : UserRec;
- i : Integer;
- found : boolean;
- Time : Integer;
-
- begin
-
- FILLCHAR(SingleUser,sizeof(SingleUser),#0);
-
- found := false;
- Time := 0;
- if(UserCount = 0) then
- begin
- found := false;
- FirstDate := Copy(Str,9,8);
- FirstTime := Copy(Str,19,5);
- end
-
- else
-
- begin
-
- i := 0;
- REPEAT
- i := succ(i);
- SingleUser := User[i];
- if SingleUser.Call = Call then
- begin
- Time := TimeDiff(Str);
- if(Time >= 0) then
- begin
- SingleUser.Count := SingleUser.Count + 1;
- SingleUser.Bytes := SingleUser.Bytes + ByteCount;
- Uebersicht[Tag,Stunde] := Uebersicht[Tag,Stunde] + 1;
- SingleUser.Dauer := SingleUser.Dauer + Time;
- Bytes[Stunde] := Bytes[Stunde] + ByteCount;
- AllTime := AllTime + Time;
- User[i] := SingleUser;
- found := true;
- if(Time <= 0) then Time:= 1;
- Baud_std[Stunde] := Baud_std[Stunde] + (ByteCount / Time * 8 / 60);
- end;
- end;
- UNTIL found OR (i >= UserCount);
- end;
-
- NewUser := not found;
-
- end;
-
-
- procedure GetUser(Str:AnyStr);
- Var SingleUser : UserRec;
- Time : Integer;
-
- begin
-
- FILLCHAR(SingleUser,sizeof(SingleUser),#0);
-
- Time := 0;
- Time := TimeDiff(Str);
-
- if Time >= 0 then
- begin
- SingleUser.Call := Call;
- SingleUser.Count := 1;
- SingleUser.Bytes := ByteCount;
- Uebersicht[Tag,Stunde] := Uebersicht[Tag,Stunde] + 1;
- If FirstTag = 0 then FirstTag := Tag;
- SingleUser.Dauer := SingleUser.Dauer + Time;
- Bytes[Stunde] := Bytes[Stunde] + ByteCount;
- AllTime := AllTime + Time;
- User[UserCount] := SingleUser;
- UserCount := UserCount + 1;
- if(Time <= 0) then Time := 1;
- Baud_std[Stunde] := Baud_std[Stunde] + (ByteCount / Time * 8 / 60);
- end;
- end;
-
- procedure LogScan;
- Var Zeile : String[255];
- Error : Integer;
-
- begin
- Zeile := ' ';
- Error := 0;
- { Oeffnen des Log's }
-
- Assign(LogFile,ParamStr(2));
- {$I-} reset(LogFile); {$I+}
- If IOResult <> 0 then
- begin
- writeln(ParamStr(2),' nicht gefunden');
- exit;
- end
-
- else
-
- begin
- writeln;
-
- writeln('Connects Benutzer Bytes');
-
- repeat { Schleife bis File-Ende}
-
- readln(LogFile,Zeile);
-
- write(#13,LogCount:6,' ',UserCount:8);
-
- if Zeile[27] <> '?' then
- begin
- LogCount := LogCount + 1;
- Call := Copy(Zeile,1,6);
- if NewUser(Zeile) then getUser(Zeile);
-
- case Zeile[37] of
- '1' : Channel1 := Channel1 + 1;
- '2' : Channel2 := Channel2 + 1;
- '3' : Channel3 := Channel3 + 1;
- '4' : Channel4 := Channel4 + 1;
- '5' : Channel5 := Channel5 + 1;
- '6' : Channel6 := Channel6 + 1;
- '7' : Channel7 := Channel7 + 1;
- '8' : Channel8 := Channel8 + 1;
- '9' : Channel9 := Channel9 + 1;
- end;
-
- write(ByteCount:10:0);
-
- end;
-
- until eof(LogFile);
- LastDate := Copy(Zeile,9,8);
- LastTime := Copy(Zeile,19,5);
-
- writeln(#13#10#10#10'Sortierlauf ...');
- Sort;
- Writeln(^M^J^M^J' Mit Drucker? (J/N)');
- ch := readkey;
- ch := upcase(ch);
-
- Drucker := (Ch = 'J');
-
- Writeln(^M^J^M^J' Mit Import-Option für DIE BOX? (J/N)');
- ch := readkey;
- ch := upcase(ch);
-
- BoxProto := (Ch = 'J');
-
- if Drucker then
- begin
- writeln(Lst,'Log-Analyse vom ',FirstDate,' bis zum ',LastDate);
- writeln(lst);
- end;
-
- if(BoxProto) then
- begin
- assign(ImportChan,'STAT.IMP');
- rewrite(ImportChan);
- end;
-
- OutUebersicht(Drucker);
- OutUser(Drucker);
- OutChannel(Drucker);
-
- end;
- Close(LogFile);
- if(BoxProto) then Close(ImportChan);
- end;
-
-
-
- begin
-
- { Initialisierung der Globalen Variablen }
-
- lowvideo;
- FillChar(User,SizeOf(User),0);
-
- For I :=1 to 31 do
- begin
- For N := 0 to 23 do Uebersicht[I,N] := 0;
- end;
-
- For N := 0 to 23 do begin;Betrieb[N] := 0;Bytes[N]:=0;Baud_std[N]:=0;end;
-
- maxBetrieb := 0;
- UserCount := 0;
- LogCount := 0;
- AllTime := 0.0;
- Channel1 := 0;
- Channel2 := 0;
- Channel3 := 0;
- Channel4 := 0;
- Channel5 := 0;
- Channel6 := 0;
- Channel7 := 0;
- Channel8 := 0;
- Channel9 := 0;
- FirstTag := 0;
- maxTag := 0;
- MaxTime := 0;
- MaxByte := 0;
- GlobalByteCount := 0;
- GlobalBytesDurch := 0;
- Baud := 0;
- MaxBaud := 0;
- MinBaud := 5000;
- Drucker := false;
- Call := ' ';
- Ch := ' ';
- FirstDate := ' ';
- LastDate := ' ';
- AllTime := 0;
- Stunde := 0;
- Tag := 0;
- maxBetrieb := 0;
- i := 0;
- N := 0;
- UserTime := 0;
- ByteCount := 0;
-
- writeln('Log-Analyse fuer DIE BOX ab Version 1.4 DF3AV, 14.09.1988');
- writeln(' DB9AP, 18.03.1988');
-
- if ParamCount <> 2 then
- begin
- writeln('Parameter fehlerhaft! Aufruf: LOGSCAN BOXCALL FILENAME');
- Halt;
- end
-
- else
-
- LogScan;
-
- if Drucker then write(lst,#12);
-
- end.
-